Method and apparatus for OCR detection of valuable documents by means of a matrix camera

ABSTRACT

The invention relates to a method for OCR detection of valuable documents in a cash dispenser in the case of which an image of the valuable document is detected by means of a digital video or matrix camera. A Hough transformation is used to calculate edge lines of the valuable document and a rotation angle is calculated therefrom such that the edges of the valuable document are aligned with the image edges. The detected image is homogenized to compensate an inhomogeneous image background. This is followed by OCR detection of alphanumeric information on the valuable document.

FIELD OF THE INVENTION

The invention relates in general to the detection of valuable documentssuch as, for example, checks or banknotes in self-service machines, inparticular cash dispensers or automatic teller machines, and relates inparticular to the detection of digital images of valuable documents bymeans of a video or matrix camera, and preprocessing thereof inself-service machines, in particular cash dispensers.

BACKGROUND OF THE INVENTION

Valuable documents in cash dispensers are usually detected by means ofline cameras which scan in valuable documents line by line in the mannerof a flat bed scanner. These detection modules require exact alignmentof the valuable documents in respect of the line direction of the imagesensor. This can therefore be implemented easily by means of mechanicalguiding and centering aids because the latter can be arranged outsidethe comparatively narrow detection region for detecting a scanned line.

However, such image sensors are comparatively costly, which renders itdesirable to detect images by means of conventional video or matrixcameras, given that the latter can be obtained cost-effectively.

DE 100 10 621 B4 discloses a method for quickly locating address blocksin grayscale images, which method is based on the finding that textgenerally contains both horizontally dominant and vertically dominantpoints in approximately equal values. Text kernels are marked in themethod which comprise a group of starting points in fixed mutualproximity, there being for each starting point at least one horizontallydominant point and at least one vertically dominant point. This textkernel is then used to undertake an OCR detection. The grayscale imageis acquired by means of a line camera in this method.

DE 195 32 342 C1 discloses an imaging system for automatic addressdetection on large letters and parcels with the aid of a high-resolutiongrayscale value camera and a low-resolution color camera. Both camerasare aligned with a light slit past which the object to be processed isguided. The color camera is operated in a special mode which enables theuse of only one common light slit, an adequate light intensity beingprovided for both cameras. The signal of the multiplicity of elements ofa color picture line is integrated over time and electronically averagedafter the exposure. However, this design is comparatively expensive.

DE 10 2004 020 034 A1 discloses a scanner for digitally reading anewspaper which is deposited on an original table. A camera module hastwo sensors directed onto the original table and on which a region ofthe original table is respectively imaged via an optical system.Furthermore provided is an illuminating module which has at least twoilluminating units which are arranged in parallel with a connecting lineof the sensors on opposite sides of the camera module and are directedonto the original table. The aim of this is to realize homogeneousillumination of the original newspaper. In order further to homogenizeillumination, it is possible for camera and illumination modules to bemoved in a secondary scanning direction parallel to the surface of theoriginal table, the regions imaged on the sensors sweeping over at leastone predetermined region on the original table. An exact alignment ofthe original is possible owing to the use of an original table withwell-defined edges, as well as a lay-on edge.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a method and anapparatus for OCR detection of valuable documents in a self-servicemachine, in particular a cash dispenser or automatic teller machine,which can be used to reliably detect valuable documents such as, forexample, checks or else banknotes, by means of a video or matrix camerain a simple and cost-effective way.

This object is achieved according to the present invention by a methodhaving the features of Claim 1 and an apparatus having the features ofClaim 8. Further advantageous embodiments are the subject matter of thedependent claims.

According to the present invention, it is possible in particular tocompensate for the facts that the background of an image, recorded bymeans of a video or matrix camera, of a valuable document depends on theillumination and is therefore inhomogeneous, that the object does notalways lie properly aligned under the camera and perspective and/orradial distortions also result depending on camera position, and thatthe resolution of the acquired image decreases towards the edge.

OVERVIEW OF FIGURES

The invention is described below in an exemplary way and with referenceto the attached drawings from which further features, advantages andobjects to be achieved emerge. In the drawings:

FIG. 1 is a schematic of the detection of a valuable document depositedon a depositing plate by means of a video or matrix camera in a valuabledocument detection module in accordance with the present invention;

FIG. 2 is a schematic block diagram of an image evaluation module of aninventive valuable document detection module;

FIG. 3 shows a flowchart of the basic steps of an inventive method forOCR detection of valuable documents in a cash dispenser;

FIG. 4 is a schematic flowchart of the steps of an automatic finerotation for automatically aligning and cutting to size a rectangulardetail as valuable document region in the acquired image;

FIG. 5 is a schematic flowchart of the most important steps of ahomogenization during an inventive method in preparation for imagebinarization; and

FIGS. 6a-6l show results of diverse method steps according to thepresent invention with the aid of an example for the detection of acheck in the so-called Bolletini check format.

DETAILED DESCRIPTION OF A PREFERRED EXEMPLARY EMBODIMENT

In accordance with FIG. 1, the matrix or video camera 2 arranged aboveor below the depositing plate 3 acquires the valuable document 4deposited on the depositing plate 3, the field of view 5 of the camera 2extending up to the edges of the latter and being larger than customaryvaluable documents 4 to be detected. The latter are usually not alignedexactly with the edges of the depositing plate 3 but rather are tilted,a circumstance that must be taken into account. The background of suchan image acquired with the aid of the camera 2 is dependent on theillumination and inhomogeneous. Depending on the camera position,moreover, perspective and radial distortions occur in the acquiredimage. Moreover, the resolution of the image decreases toward the edge.

The camera 2 with its image sensor 13 corresponds to an image signalgenerator 11 of the image evaluation module 10 shown in FIG. 2. Theimage sensor 13 acquires a digital image of the valuable document with apredetermined resolution. The digital images thus acquired are firstlybuffered in the memory 15 and subsequently processed further in an imageprocessing section 16. The data processing section 12 of the imageevaluation module 10 further comprises a central control device (CPU) 14which is connected to a program code memory 18, in which program codeinstructions for executing the inventive method are stored, a controlsection 19, for example for presetting the image evaluation module 10,the image processing section 16, the memory 15 and an image outputdevice 17.

In accordance with FIG. 3, during a method for OCR detection of valuabledocuments a digital image of the valuable document is firstly acquiredin step S301 and is radially corrected as required in step S302 with theaid of the physical properties of the camera objective (focal length,distortion, etc.). Moreover, it is also possible for the image also tobe perspectively corrected with the aid of the camera position inrelation to the edges of the depositing plate, this being, inparticular, dependent on the distance of the camera from the depositingplate, and on the focal length in use, but is not mandatory.

Subsequently, in step S303 the valuable document is identified and itsposition determined in order to identify a valuable document region,that is to say to identify pixels which correspond to the valuabledocument deposited on the depositing plate. In step S304, a finerotation is then performed such that the edges of the valuable documentregion which is then rotated are aligned with the image edges, that isto say extend substantially parallel thereto. Subsequently in step S305there is cut to size from the acquired image a rectangular region whichcorresponds to the valuable document region in which it is intended toexecute OCR detection later.

Subsequently, in step S306 the image background is homogenized, andafter that an image is stored for later OCR analysis in step S307. TheOCR analysis can be executed by means of conventional OCR algorithmswhich are sufficiently well known and therefore have no need to beconsidered further.

The steps of an automatic fine rotation for aligning the acquiredvaluable document region are explained below with the aid of FIG. 4. Inorder to carry out a fine rotation, the valuable document must first beidentified, and its position must be determined. To this end, it isadvantageous to work on a reduced image, since it is thereby possible toattain a higher processing speed. Moreover, it is advantageous to workfrom a reduced image in which interfering or superfluous details suchas, for example, alphanumeric characters, graphic information, or elsedust filaments and interfering lines are removed. The point is that suchdetailed information is not needed for determining the edges andposition of the valuable document. Such details can be removed by usingsuitable filters including, for example, the median filter on which stepS402 is based and in the case of which the grayscale value of thecurrent pixel is replaced by the median of the grayscale values of thecurrent environment, it being possible to prescribe the size of theenvironment in a variable fashion, for example, via the control section19.

The valuable document region is then identified in step S403 byautomatic thresholding. For example, the image processing sectiondetermines whether a pixel value is greater than a predeterminedthreshold or not, in order thus to binarize an edge image. The thresholdcan be a fixed value, or a variable which is obtained, for example, withthe aid of a variable threshold method. Of course, it is also possiblefor this purpose to use any other desired algorithms for edgeidentification.

In the next step S404, the edge pixels of the valuable document regionare then calculated. Subsequently, in step S405 a Hough transformationis used to detect the dominant lines in the image. In the Hough methoddisclosed in U.S. Pat. No. 3,069,654, geometrical objects are detectedby creating a dual space in which all possible parameters of thegeometrical figure to be found are plotted in the dual space for eachpoint in the image which lies on an edge. Each point in the dual spacethereby corresponds to a geometrical object in the image space. Whendetecting straight lines by means of the Hough transformation, it isnecessary firstly to find suitable parameters on a straight line, forexample, slope and y-intercept or, preferably, a characterization of astraight line by its Hessian normal form. It is advantageous here thatthe edges in the starting image were firstly determined in step S404.During the Hough transformation, it is determined for each pixel whichline (for example, as determined by angle and distance from theleft-hand, upper image corner) runs through it. If the pixel underconsideration is an edge pixel, the assessment of the line is raised.The most highly assessed lines then correspond to the dominant lines inthe image region.

These dominant lines can then be used in step S406 to easily determinethe angle by which the valuable document region must be rotated in orderto correct its misalignment and align it parallel to the edges of thefield of view or image edges or the depositing plate. Subsequently, theimage of the valuable document region is then rotated by this determinedrotation angle in step S407. Subsequently, a rectangular image regionwhich contains the valuable document region is cut out in step S408.Owing to the previously performed flush rotation, the alphanumericcharacters in this region are aligned flush with the image edges in thecase of the underlying rectangular original format, at any rate when anappropriate image correction has been executed previously. Precisely inthe case of smaller image formats, such as occur with customary valuabledocuments, such image distortions are, however, not so interfering thatthey must necessarily be compensated. Rather, according to the inventionit is possible to reliably execute an OCR detection of alphanumericcharacters even when the alphanumeric characters are not exactly alignedwith the image edges after step S407.

FIGS. 6a-6l summarize the results of the abovenamed method steps withthe aid of the practical example of the detection of a check in theso-called Bolletini check format. In accordance with FIG. 6a , the imageof the check acquired by the depositing plate contains the black edgeregion 60 without any information and the actual valuable documentregion 61, which contains the graphic image information 62, letters 63,digits 64, and a barcode 65. On view are an inhomogeneous illuminationof the image region and a reflection somewhat in the middle of theimage, these being the result of reflections from the surface of thedepositing plate.

In order quickly to identify and determine the position of the valuabledocuments, it is preferred to work on a reduced image on which thedetails, such as font, dust filaments and lines on the check itself havebeen removed by applying a median filter, as shown in FIG. 6b . On vieware Blurry details 66 and furthermore, significant image components inthe regions 67, which result from the barcode and the graphic symbol onthe check (compare FIG. 6a ).

The check is then identified by automatic thresholding (compare FIG. 6c) and an edge filter is applied to determine the edges of dominantregions, as shown in FIG. 6d , specifically the edges 68 of the valuabledocument, and the edges 69 of further prominent details, in particularresulting from the above-named barcode. The edges are subsequentlycalculated by means of a Hough transformation. These are indicated inFIG. 6e by the lines 70. It can be seen that said lines do not runparallel to the image edges. However, the rotation angle relevant herecan easily be calculated from the edge image in accordance with FIG. 6e.

As shown in FIG. 6a , with the aid of the rotation angle thusdetermined, the acquired image, that is to say the image having the fullimage resolution, is rotated, and the regions outside of the calculatededge lines are subsequently cut off (compare FIG. 6e ), and this resultsin the rectangular image region shown in FIG. 6f , which contains theactual valuable document region 61, but also edge regions 60 whichadditionally result from unavoidable image distortions, for example,resulting from the camera objective. However, it has been shown that OCRdetection can also be executed reliably even on original images thusprepared.

A simple image binarization based on the image information in accordancewith FIG. 6f would, however, lead to the result shown in FIG. 6g inwhich, for example, the text information is missing in the region of thecamera owing to reflections in the middle of the image, but is still tobe seen unclearly.

For homogenization, a brightness map of the image background is createdand then subtracted in principle from the original image in accordancewith FIG. 6f . However, to further speed up the process here it ispossible to reduce the image again, for example to ⅛ of the originalsize. The result is shown in FIG. 6h . A median filter which removes thedetails from the image is then applied. The background image therebyresulting after the median filtering is in FIG. 6i . In the case of amedian filter, a list of the value of all the neighbor pixels is createdfor each pixel and sorted, and the original pixel is replaced by thevalue found in the middle of the list. The size of the filter in thiscase regulates the size of this neighborhood. The filter has theproperty that coarse structures remain, small structures being smoothed.With relative pixel accuracy, the image generated still contains herethe coarse brightness distribution on the check background. This imagebackground is subtracted from the original image in accordance with FIG.6f , the result being the image in accordance with FIG. 6j . Said imageis inverted, and this results in the image in accordance with FIG. 6k .It is to be seen that, for example, the text information in the middleof the image is substantially easier to read and evaluate in this image.Said image is then binarized, that is to say translated into brightnessvalues 1 or 0. The resulting starting image for the OCR detection isshown in FIG. 6l . The text can then be segmented and made available forthe subsequent OCR software.

In summary, the inventive method can be used to reliably execute OCRdetection by means of a matrix or video camera. It may expressly bepointed out that the invention can be used in any desired self-servicemachine, in particular in automatic teller machines or cash dispenserswhose function is to support the automatic submission of valuabledocuments such as, for example, checks.

LIST OF REFERENCE NUMERALS

1 Valuable document detection module

2 Video camera/matrix camera

3 Depositing plate

4 Valuable document

5 Field of view of camera 2

6 Valuable document region

10 Image evaluation module

11 Image signal generator

12 Data processing section

13 Image sensor

14 CPU

15 Memory

16 Image processing section

17 Image output device

18 Program code memory

19 Control section

60 Edge region

61 Valuable document region

62 Graphic information

63 Letters

64 Digits

65 Barcode

66 Blurry details

67 Further prominent details

68 Edge of valuable document

69 Edge of further prominent details

70 Calculated edge lines

71 Region of higher brightness

The invention claimed is:
 1. Method for optical character recognition(OCR) detection of documents in a self-service machine, in particular anautomatic teller machine or cash dispenser, comprising: a) detecting animage of a document by means of a digital video or matrix camera havinga detection region; b) establishing an intermediate document image by:i) reducing the detected image, ii) determining a position of a documentregion, corresponding to the document and also edge pixels in thedetected image, iii) detecting straight edge lines of the documentregion with the aid of the determined edge pixels by using a Houghtransformation, iv) determining a rotation angle by which the documentregion in the detected image must be rotated for alignment at edges ofthe detection region of the digital video or matrix camera, and v)rotating the document region by the rotation angle, resulting in theintermediate document image; and c) forming a background image by: i)reducing the intermediate document image, ii) after said reducing theintermediate document image, removing smaller details from the reducedintermediate document image by filtering the document region, resultingin the background image; d) creating a brightness map of the backgroundimage; and e) binarizing the background image to segment alphanumericcharacter information.
 2. Method according to claim 1, in which use ismade in said detecting straight edge lines of an edge filter whichoutputs a binary edge image of the document region.
 3. Method accordingto claim 2, in which the Hough transformation is executed with the aidof the binary edge image.
 4. Method according to claim 3, in whichduring the Hough transformation it is determined for each pixel, whichline runs therethrough, and an assessment of each line is raised whenthe pixel is an edge pixel, the straight edge lines corresponding to thelines most highly assessed.
 5. Method according to claim 1, in whichsaid forming the background image furthermore comprises: subtracting thebrightness map from the detected intermediate document image. 6.Apparatus for optical character recognition (OCR) detection of documentsin a self-service machine, in particular an automatic teller machine orcash dispenser, in particular designed as a document detection module,comprising: a digital video or matrix camera having a detection regionin order to detect an image of a document; and an image processingsection which is designed in order to: a) establish an intermediatedocument image by: i) reducing the detected image, ii) determining aposition of a document region, corresponding to the document and alsoedge pixels in the detected image, iii) detecting straight edge lines ofthe document region with the aid of the determined edge pixels by usinga Hough transformation, iv) determining a rotation angle by which thedocument region must be rotated for alignment at edges of the detectionregion of the digital video or matrix camera, and v) rotating thedocument region by the rotation angle, resulting in the intermediatedocument image; and c) form a background image by: i) reducing theintermediate document image, ii) removing smaller details from thereduced intermediate document image after reducing the intermediatedocument image by filtering the document region, resulting in thebackground image; and d) creating a brightness map of the backgroundimage and binarizing the background image to detect alphanumericcharacter information by OCR detection.
 7. Apparatus according to claim6, in which the image processing section is further designed to apply anedge filter which outputs a binary edge image of the document region. 8.Apparatus according to claim 7, in which the Hough transformation isexecuted with the aid of the binary edge image.
 9. Apparatus accordingto claim 8, in which during the Hough transformation it is determinedfor each pixel, which line runs therethrough, and an assessment of eachline is raised when the pixel is an edge pixel, the straight edge linescorresponding to the lines most highly assessed.
 10. Apparatus accordingto one of claim 6, in which the image processing section is furtherdesigned to subtract said brightness map from the intermediate documentimage.